package ie.dcu.spca.model.bean;

import ie.dcu.spca.model.Bean;
import ie.dcu.spca.model.dao.ItemDao;

import java.util.Date;

public class ItemsUsers extends Bean {
    private int item_id;
    private String user_id;
    private int count;

    public ItemsUsers(int id, int item_id, String user_id, int count,
            Date creat_at, Date update_at, Date delete_at) {
        super();
        this.id = id;
        this.item_id = item_id;
        this.user_id = user_id;
        this.count = count;
        this.create_at = creat_at;
        this.update_at = update_at;
        this.delete_at = delete_at;
    }

    public ItemsUsers(int id, int item_id, String user_id, int count,
            long creat_at, long update_at, long delete_at) {
        super();
        this.id = id;
        this.item_id = item_id;
        this.user_id = user_id;
        this.count = count;
        this.create_at = new Date(creat_at);
        this.update_at = new Date(update_at);
        this.delete_at = new Date(delete_at);
    }

    public Item getItem() {
        ItemDao Id = new ItemDao();
        return (Item) Id.selectById(this.item_id);
    }

    // public User getUser(){
    // UserDao ud = new UserDao();
    // return (User) ud.selectById(this.user_id);
    // }
    //	
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getItem_id() {
        return item_id;
    }

    public void setItem_id(int item_id) {
        this.item_id = item_id;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Date getCreate_at() {
        return create_at;
    }

    public void setCreate_at(Date creat_at) {
        this.create_at = creat_at;
    }

    public Date getUpdate_at() {
        return update_at;
    }

    public void setUpdate_at(Date update_at) {
        this.update_at = update_at;
    }

    public Date getDelete_at() {
        return delete_at;
    }

    public void setDelete_at(Date delete_at) {
        this.delete_at = delete_at;
    }

}
